package com.blog;

import org.springframework.core.io.support.PropertiesLoaderUtils;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Properties;

/**
 * 2 * @Author: Tcj
 * 3 * @Date: 2021/1/20 20:33
 * 4
 */
public class Config {
    //过期时间
    public static  long EXPIRE_TIME = 0;
    //私钥
    public static  String TOKEN_SECRET = "" ;
    // 日期格式定义
    public static SimpleDateFormat sdf	= new SimpleDateFormat("MMddHHmmss");
    public static String userid = "";
    public static String pwd = "";
    public static  String masterIpAddress = "";
    public static String updatePath = "";
    public static String readPath = "";
    public static String targetPath = "";
    static {
        try {
            Properties properties = PropertiesLoaderUtils.loadAllProperties("config.properties");
            EXPIRE_TIME = Long.parseLong(properties.getProperty("EXPIRE_TIME"));
            TOKEN_SECRET = properties.getProperty("TOKEN_SECRET");
            userid =  properties.getProperty("sms.userid");
            pwd =  properties.getProperty("sms.pwd");
            updatePath =  properties.getProperty("uploadPath");
            readPath =  properties.getProperty("readPath");
            masterIpAddress =  properties.getProperty("sms.masterIpAddress");
            targetPath =  properties.getProperty("targetPath");

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
